package com.icode.core.model.order;

import com.icode.core.dto.house.ForEnumDTO;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-9-29
 * Time: 上午9:42
 * To change this template use File | Settings | File Templates.
 */
public enum AlipayStatus {

    PAY_SUCCESS("支付成功"),
    PAY_FAIL("支付失败");

    private String label;

    private AlipayStatus(String label) {
        this.label = label;
    }

    public String getLabel() {
        return label;
    }

    public static List<ForEnumDTO> toDTO() {
        List<ForEnumDTO> forEnumDTOs = new ArrayList<>();
        for (AlipayStatus alipayStatus : AlipayStatus.values()) {
            String value = alipayStatus.name();
            String label = alipayStatus.getLabel();
            ForEnumDTO forEnumDTO = new ForEnumDTO(value, label);
            forEnumDTOs.add(forEnumDTO);
        }
        return forEnumDTOs;
    }
}
